package com.youthfilmic.yuejian.domain;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by youweixi on 15/10/7.
 * 约见申请
 */
@Entity
public class Application {

    /**
     * 申请状态
     * */
    //（未支付0（后面的状态都是已支付）
    public static int STATUS_WAIT_FOR_PAID = 0;
    //待处理1
    public static int STATUS_WAIT_FOR_HANDLE = 1;

    //已通过待评价2
    public static int STATUS_ACCEPT_WAIT_FOR_COMMENT = 2;

    //已通过已完成已评价3
    public static int STATUS_ACCEPT_COMMEND = 3;
    //已通过已完成已付款4
    public static int STATUS_ACCEPT_COMMEND_PAID = 4;
    //已拒绝已完成待退款-1
    public static int STATUS_DENY = -1;
    //已拒绝已完成已退款-2
    public static int STATUS_DENY_PAID_BACK = -2;

    @Id
    @GeneratedValue
    private Long id;
    /**
     * 用户id
     * */
    private Long userId;
    /**
     * 用户
     * */
    @ManyToOne
    private User user;
    /**
     * 牛人id
     * */
    private Long starId;
    /**
     * 牛人姓名
     * */
    private String starName;
    /**
     * 牛人
     * */
    @ManyToOne
    private User star;
    /**
     * 牛人的话题
     * */
    private String subjectTitle;
    /**
     * 话题id
     * */
    private Long subjectId;
    /**
     * 牛人话题
     * */
    @ManyToOne
    private Subject subject;
    /**
     * 约见价格
     * */
    private int price;
    /**
     * 约见时长
     * */
    private int duration;
    /**
     * 申请状态
     * */
    private int status;
    /**
     * 申请日期
     * */
    private Date postAt;
    /**
     * 处理日期
     * */
    private Date handleAt;
    /**
     * 拒绝理由
     * */
    private String reason;


    /**
     * 申请信息
     * */
    /**
     * 个人姓名
     * */
    private String realName;
    /**
     * 手机号
     * */
    private String phone;
    /**
     * 微信号
     * */
    private String weixin;
    /**
     * 推荐人
     * */
    private String presenter;
    /**
     * 自我介绍
     * */
    @Column(columnDefinition="TEXT")
    private String instruction;
    /**
     * 想聊什么
     * */
    @Column(columnDefinition="TEXT")
    private String chatContent;
    /**
     * 活动区域
     * */
    private String region;
    /**
     * 未来两周方便见面时间
     * */
    private String dateTime;

    /**
     * 评价
     * */
    private boolean userComment;
    /**
     * 评价Id
     * */
    private Long userCommentId;
    /**
     * 评价
     * */
    private boolean starComment;
    /**
     * 评价Id
     * */
    private Long starCommentId;

    public Application(){
        //默认状态为等待支付
        this.status = Application.STATUS_WAIT_FOR_PAID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getStarId() {
        return starId;
    }

    public void setStarId(Long startId) {
        this.starId = startId;
    }

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getPostAt() {
        return postAt;
    }

    public void setPostAt(Date postAt) {
        this.postAt = postAt;
    }

    public Date getHandleAt() {
        return handleAt;
    }

    public void setHandleAt(Date handleAt) {
        this.handleAt = handleAt;
    }

    public String getInstruction() {
        return instruction;
    }

    public void setInstruction(String instruction) {
        this.instruction = instruction;
    }

    public String getChatContent() {
        return chatContent;
    }

    public void setChatContent(String chatContent) {
        this.chatContent = chatContent;
    }

    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public boolean isUserComment() {
        return userComment;
    }

    public void setUserComment(boolean userComment) {
        this.userComment = userComment;
    }

    public boolean isStarComment() {
        return starComment;
    }

    public void setStarComment(boolean starComment) {
        this.starComment = starComment;
    }


    public String getStarName() {
        return starName;
    }

    public void setStarName(String starName) {
        this.starName = starName;
    }

    public String getSubjectTitle() {
        return subjectTitle;
    }

    public void setSubjectTitle(String subjectTitle) {
        this.subjectTitle = subjectTitle;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getWeixin() {
        return weixin;
    }

    public void setWeixin(String weixin) {
        this.weixin = weixin;
    }

    public String getPresenter() {
        return presenter;
    }

    public void setPresenter(String presenter) {
        this.presenter = presenter;
    }

    public int getDuration() {
        return duration;
    }

    public String getDurationString() {
        return DomainInfo.getDurationMap().get(duration);
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public User getStar() {
        return star;
    }

    public void setStar(User star) {
        this.star = star;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Long getStarCommentId() {
        return starCommentId;
    }

    public void setStarCommentId(Long starCommentId) {
        this.starCommentId = starCommentId;
    }

    public Long getUserCommentId() {
        return userCommentId;
    }

    public void setUserCommentId(Long userCommentId) {
        this.userCommentId = userCommentId;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }
}
